package repository

import (
	"gitee.com/cristiane/micro-mall-order/model/mysql"
	"gitee.com/kelvins-io/kelvins"
)

func CreateTccBranchTxRecord(model *mysql.TccBranchTransactionRecord) (err error) {
	_, err = kelvins.XORM_DBEngine.Table(mysql.TableTccBranchTransactionRecord).Insert(model)
	return
}

func UpdateTccBranchTxRecord(where, maps map[string]interface{}) (int64, error) {
	return kelvins.XORM_DBEngine.Table(mysql.TableTccBranchTransactionRecord).Where(where).Update(maps)
}

func GetTccBranchTxRecord(sqlSelect string, where map[string]interface{}) ([]mysql.TccBranchTransactionRecord, error) {
	result := make([]mysql.TccBranchTransactionRecord, 0)
	err := kelvins.XORM_DBEngine.Table(mysql.TableTccBranchTransactionRecord).Select(sqlSelect).Where(where).Find(&result)
	return result, err
}
